xen/arm: second irq injection while the first irq is still inflight
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Tue, 10 Jun 2014 14:07:17 +0000 (15:07 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 18 Jun 2014 10:31:59 +0000 (11:31 +0100)
commit394b7e587b05d0f4a5fd6f067b38339ab5a77121
tree97e222db2b00f8a37dae8631a452aeb3d37e8c6e
parent229739b36646e657b8f9d75b1e5d249fd36773f8
xen/arm: second irq injection while the first irq is still inflight

Set GICH_LR_PENDING in the corresponding GICH_LR to inject a second irq
while the first one is still active.
If the first irq is already pending (not active), clear
GIC_IRQ_GUEST_QUEUED because the guest doesn't need a second
notification.If the irq has already been EOI'ed then just clear the
GICH_LR right away and move the interrupt to lr_pending so that it is
going to be reinjected by gic_restore_pending_irqs on return to guest.

If the target cpu is not the current cpu, then set GIC_IRQ_GUEST_QUEUED
and send an SGI. The target cpu is going to be interrupted and call
gic_clear_lrs, that is going to take the same actions.

Do not call vgic_vcpu_inject_irq from gic_inject if
evtchn_upcall_pending is set. If we remove that call, we don't need to
special case evtchn_irq in vgic_vcpu_inject_irq anymore.
We need to force the first injection of evtchn_irq (call
gic_vcpu_inject_irq) from vgic_enable_irqs because evtchn_upcall_pending
is already set by common code on vcpu creation.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/gic.c
xen/arch/arm/vgic.c
xen/include/asm-arm/gic.h